#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N = 5e5+10; 
int n,op,x,y,z,cnt; 
double sum,ans[N],mi;
struct w
{
	int f,t,b,v; 
	double l;
}a[N];
signed main()
{
	freopen("love.in","r",stdin);
	freopen("love.out","w",stdout);
	scanf("%lld",&n);
	for(int i = 1;i <= n;i++)
	{
		scanf("%lld",&op);
		if(op == 1) 
		{
			scanf("%lld%lld%lld",&x,&y,&z),a[++cnt].f = x,a[cnt].t = y,a[cnt].b = z;
			if(a[cnt].t == 0) a[cnt].l = 1;
			else a[cnt].l = (1.0*(a[cnt].t*a[cnt].f+a[cnt].b)/a[cnt].t);
			for(int z = 1;z <= cnt;z++) 
				if(!a[z].v) ans[cnt] += abs(1.0*(1.0*a[z].t*(a[z].f-a[cnt].l)+a[z].b));
			for(int z = 1;z <= cnt;z++) 
				if(!a[z].v) ans[z] += abs(1.0*(1.0*a[cnt].t*(a[cnt].f-a[z].l)+a[cnt].b));
		}
		else 
		{
			scanf("%lld",&x),a[x].v = 1;
			for(int z = 1;z <= cnt;z++) 
				if(!a[z].v) ans[z] -= abs(1.0*(1.0*a[x].t*(a[x].f-a[z].l)+a[x].b));
		}
		mi = 1e15;
		for(int j = 1;j <= cnt;j++)
		{
			if(a[j].v) continue;
			mi = min(mi,ans[j]);
		}
		printf("%.10f\n",mi);
	}
	return 0;
}


